package webpage;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;

public class PendingFriendsList {

	public ArrayList<String> pendingFriendsList(String loginEmail) throws FileNotFoundException{
		
		String path = "C:/SVN/WebContent/Members/"+loginEmail+"/pendingrequests.txt";
		Scanner s = new Scanner(new File(path));
		ArrayList<String> pendingFriendsList = new ArrayList<String>();
		
	try
	{
		if (!s.hasNext()){
			pendingFriendsList=null;
		}
		else {
		while (s.hasNext()){
			pendingFriendsList.add(s.next());
		}
		s.close();}}
	catch(NullPointerException e){
		pendingFriendsList=null;
	}
	return pendingFriendsList;
	}
}
